package com.juc.threadPoolExecutor.threadPoolExecutor4;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test1 {

	public static void main(String[] args) throws InterruptedException {
		MyRunnableA a1 = new MyRunnableA("A1");
		MyRunnableA a2 = new MyRunnableA("A2");
		MyRunnableA a3 = new MyRunnableA("A3");
		MyRunnableA a4 = new MyRunnableA("A4");
		ThreadPoolExecutor pool = new ThreadPoolExecutor(2, 10, 30, TimeUnit.SECONDS, new LinkedBlockingDeque<Runnable>());
		pool.execute(a1);
		pool.execute(a2);
		pool.execute(a3);
		pool.execute(a4);
		Thread.sleep(1000);
		pool.shutdown();
		System.out.println(" main end! ");
	}
	
}
